#include "FacetMeta.h"

#include <string.h>
#include <fan-llvm/core/Core.h>
#include "Type.h"
#include "UnsupportedErr.h"


Type* FacetMeta_classType = NULL;
VTable* FacetMeta_classVTable = NULL;


/**********************************************
 *
 * Methods and fields
 *
 **********************************************/


/* Void make(|FacetMeta->Void|? f) */
void FacetMeta_make_0(FacetMeta* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::FacetMeta.make not implemented yet"));
}


/* Void make(|FacetMeta->Void|? f) */
void FacetMeta_make(FacetMeta* self, Func* f)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::FacetMeta.make not implemented yet"));
}


/* Bool inherited */
Bool FacetMeta_inherited(FacetMeta* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::FacetMeta.inherited not implemented yet"));
}


/**********************************************
 *
 * Type-system functions
 *
 **********************************************/


Type* FacetMeta_initType(void)
{
  if (FacetMeta_classType == NULL)
  {
    Type* baseType = Obj_initType();
    VTable* vtable = FacetMeta_initVTable();
    Type* type = Type_new("FacetMeta", baseType, vtable, sizeof(FacetMeta), sizeof(FacetMetaVTable));
    Type_registerCtorImplementation(type, "make", FacetMeta_make_0, 0);
    Type_registerCtorImplementation(type, "make", FacetMeta_make, 1);
    Type_registerFieldImplementation(type, "inherited", FacetMeta_inherited, NULL);
    FacetMeta_classType = type;
    FacetMeta_initStatic();
  }
  return FacetMeta_classType;
}


VTable* FacetMeta_initVTable(void)
{
  if (FacetMeta_classVTable == NULL)
  {
    VTable* vtable = memoryAlloc(sizeof(FacetMetaVTable));
    memcpy(vtable, Obj_initVTable(), sizeof(FanObjVTable));
    FacetMeta_classVTable = vtable;
  }
  return FacetMeta_classVTable;
}


void FacetMeta_initStatic(void)
{
}
